/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "island")
@NamedQueries({
    @NamedQuery(name = "Island.findAll", query = "SELECT i FROM Island i"),
    @NamedQuery(name = "Island.findByIdisland", query = "SELECT i FROM Island i WHERE i.idisland = :idisland"),
    @NamedQuery(name = "Island.findByIsland", query = "SELECT i FROM Island i WHERE i.island = :island")})
public class Island implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idisland")
    private Integer idisland;
    @Basic(optional = false)
    @Column(name = "island")
    private String island;
    @OneToMany(mappedBy = "island", fetch = FetchType.LAZY)
    private List<Localityelement> localityelementList;

    public Island() {
    }

    public Island(Integer idisland) {
        this.idisland = idisland;
    }

    public Island(Integer idisland, String island) {
        this.idisland = idisland;
        this.island = island;
    }

    public Integer getIdisland() {
        return idisland;
    }

    public void setIdisland(Integer idisland) {
        this.idisland = idisland;
    }

    public String getIsland() {
        return island;
    }

    public void setIsland(String island) {
        this.island = island;
    }

    public List<Localityelement> getLocalityelementList() {
        return localityelementList;
    }

    public void setLocalityelementList(List<Localityelement> localityelementList) {
        this.localityelementList = localityelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idisland != null ? idisland.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Island)) {
            return false;
        }
        Island other = (Island) object;
        if ((this.idisland == null && other.idisland != null) || (this.idisland != null && !this.idisland.equals(other.idisland))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Island[idisland=" + idisland + "]";
    }

}
